//
//  NewEventNarmolCell.swift
//  YOKO
//
//  Created by Zoe_G on 16/5/13.
//  Copyright © 2016年 15Tec. All rights reserved.
//

import UIKit

class NewEventNarmolCell: NewEventViewBasicCell {

    @IBOutlet weak var cellTitleLabel: UILabel!
    
//    @IBOutlet weak var textLabelHeightConstraint: NSLayoutConstraint!
    @IBOutlet weak var switchBtn: UIButton!
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        switchBtn.setImage(UIImage(named: "switch"), forState: .Normal)
        switchBtn.setImage(UIImage(named: "switch-highlight"), forState: .Selected)
        // Initialization code
    }
    
    override func drawRect(rect: CGRect) {
        super.drawRect(rect)
        
        cellTitleLabel.text = self.imgName
        cellTitleLabel.numberOfLines = 0
        cellTitleLabel.lineBreakMode = .ByWordWrapping
        
        switchBtn.hidden = !hasSwitchBtn
       
    }
//    
//    func heightOfLabel() -> CGFloat {
//        var textHeight = NSString(string: self.cellTitleLabel.text!).boundingRectWithSize(CGSizeMake(self.cellTitleLabel.bounds.width, 9999), options: .UsesLineFragmentOrigin, attributes: [NSFontAttributeName: UIFont.systemFontOfSize(16.0)], context: nil).size.height
//        
//        //改变cell高度
//        textHeight = textHeight > 30 ? textHeight+10 : 30
//        
////        self.reminderCellHeight = textHeight+20
//        
//        return textHeight
//    }
//    


    @IBAction func switchWholeDay(sender: UIButton) {
        sender.selected = !sender.selected
        self.delegate.swithWholeDay(sender.selected)
        
    }
    
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
